home *** CD-ROM | disk | FTP | other *** search
/ Diccionario Visual Trilingue / VISUAL.iso / SHARED.DIR / 10073_Global Key Event Handlers.ls < prev    next >
Encoding:
Text File  |  1997-07-04  |  5.3 KB  |  151 lines

  1. global gTextLanguage, gCASTNUMBOGUS, gCASTNUMETIQUETTE, gSPRITENUMETIQUETTEACTIVE, gSPRITENUMHIGHLIGHT, gVignetHighLighted, gItemIDSound, gNbVignet, glstVignet, glstUpArrow, glstDownArrow, glstSpriteNumVignet, gZoneSensibleActive, gImageButtonActive, gThemeButtonActive, gHistoryButtonActive, gQuitButtonActive, gContentButtonActive, gHelpButtonActive, gLeftArrowButtonActive, gRightArrowButtonActive, gUpArrowButtonActive, gReturnArrowButtonActive, glstVignetHighLighted, gVignetNum
  2.  
  3. on HighLightEtiquet VignetNum
  4.   if (VignetNum < 1) or (VignetNum > gNbVignet) then
  5.     return 
  6.   end if
  7.   set gVignetHighLighted to getAt(glstSpriteNumVignet, VignetNum)
  8.   set glstVignetHighLighted to getAt(glstVignet, VignetNum)
  9.   set gVignetNum to VignetNum
  10.   set the castNum of sprite gSPRITENUMETIQUETTEACTIVE to gCASTNUMBOGUS
  11.   updateStage()
  12.   set the visible of sprite gSPRITENUMHIGHLIGHT to 1
  13.   set the locH of sprite gSPRITENUMHIGHLIGHT to the locH of sprite gVignetHighLighted
  14.   set the locV of sprite gSPRITENUMHIGHLIGHT to the locV of sprite gVignetHighLighted
  15.   set the ink of sprite gSPRITENUMHIGHLIGHT to 36
  16.   set the castNum of sprite gSPRITENUMHIGHLIGHT to 12058
  17.   set the textAlign of cast gCASTNUMETIQUETTE to "center"
  18.   set the textFont of cast gCASTNUMETIQUETTE to "IVD10"
  19.   set the textSize of cast gCASTNUMETIQUETTE to 10
  20.   set the foreColor of cast gCASTNUMETIQUETTE to 15
  21.   set the backColor of cast gCASTNUMETIQUETTE to 219
  22.   set lstEtiquetText to getAt(glstVignetHighLighted, gTextLanguage)
  23.   set the text of cast gCASTNUMETIQUETTE to getAt(lstEtiquetText, 1)
  24.   set DemiLargeurEtiquet to (getAt(lstEtiquetText, 2) + 4) / 2
  25.   set the rect of cast gCASTNUMETIQUETTE to rect(0, 0, DemiLargeurEtiquet * 2, 0)
  26.   set SpriteLocH to the locH of sprite gVignetHighLighted
  27.   if (SpriteLocH - DemiLargeurEtiquet) < 2 then
  28.     set theLocH to 2
  29.   else
  30.     if (SpriteLocH + DemiLargeurEtiquet) > 638 then
  31.       set theLocH to 638 - (DemiLargeurEtiquet * 2)
  32.     else
  33.       set theLocH to SpriteLocH - DemiLargeurEtiquet
  34.     end if
  35.   end if
  36.   set the locH of sprite gSPRITENUMETIQUETTEACTIVE to theLocH
  37.   set the locV of sprite gSPRITENUMETIQUETTEACTIVE to the locV of sprite gVignetHighLighted + 27
  38.   set the ink of sprite gSPRITENUMETIQUETTEACTIVE to 0
  39.   set the castNum of sprite gSPRITENUMETIQUETTEACTIVE to gCASTNUMETIQUETTE
  40.   updateStage()
  41.   set glstDownArrow to getAt(glstVignetHighLighted, 7)
  42.   set gItemIDSound to getAt(glstVignetHighLighted, 5)
  43.   if gTextLanguage = 1 then
  44.     nothing()
  45.   else
  46.     if gTextLanguage = 2 then
  47.       set gItemIDSound to gItemIDSound + 1
  48.     else
  49.       if gTextLanguage = 3 then
  50.         set gItemIDSound to gItemIDSound + 2
  51.       end if
  52.     end if
  53.   end if
  54. end
  55.  
  56. on ButtonActiveMouse
  57.   if gZoneSensibleActive = 1 then
  58.     if the mouseCast = the castNum of sprite 32 then
  59.       return 0
  60.     else
  61.       if not gImageButtonActive and (the mouseCast = the castNum of sprite 36) then
  62.         return 0
  63.       else
  64.         return 1
  65.       end if
  66.     end if
  67.   else
  68.     if gZoneSensibleActive = 2 then
  69.       if the mouseCast = the castNum of sprite 33 then
  70.         return 0
  71.       else
  72.         if not gThemeButtonActive and (the mouseCast = the castNum of sprite 35) then
  73.           return 0
  74.         else
  75.           if not gHistoryButtonActive and (the mouseCast = the castNum of sprite 36) then
  76.             return 0
  77.           else
  78.             if not gContentButtonActive and (the mouseCast = the castNum of sprite 37) then
  79.               return 0
  80.             else
  81.               return 1
  82.             end if
  83.           end if
  84.         end if
  85.       end if
  86.     else
  87.       if gZoneSensibleActive = 3 then
  88.         if not gHelpButtonActive and (the mouseCast = the castNum of sprite 1) then
  89.           return 0
  90.         else
  91.           return 1
  92.         end if
  93.       else
  94.         if gZoneSensibleActive = 4 then
  95.           if not gQuitButtonActive and (the mouseCast = the castNum of sprite 34) then
  96.             return 0
  97.           else
  98.             return 1
  99.           end if
  100.         else
  101.           if the mouseCast = the castNum of sprite 3 then
  102.             return gReturnArrowButtonActive
  103.           else
  104.             if the mouseCast = the castNum of sprite 4 then
  105.               return gLeftArrowButtonActive
  106.             else
  107.               if the mouseCast = the castNum of sprite 5 then
  108.                 return gRightArrowButtonActive
  109.               else
  110.                 if the mouseCast = the castNum of sprite 6 then
  111.                   return gUpArrowButtonActive
  112.                 else
  113.                   if the mouseCast = the castNum of sprite gVignetHighLighted then
  114.                     return 1
  115.                   else
  116.                     return 0
  117.                   end if
  118.                 end if
  119.               end if
  120.             end if
  121.           end if
  122.         end if
  123.       end if
  124.     end if
  125.   end if
  126. end
  127.  
  128. on ButtonActiveKey
  129.   if the keyCode = 36 then
  130.     return gReturnArrowButtonActive
  131.   else
  132.     if the keyCode = 123 then
  133.       return gLeftArrowButtonActive
  134.     else
  135.       if the keyCode = 124 then
  136.         return gRightArrowButtonActive
  137.       else
  138.         if the keyCode = 126 then
  139.           return gUpArrowButtonActive
  140.         else
  141.           if ((the keyCode = 76) or (the keyCode = 125)) and (gVignetHighLighted > 10) and (gVignetHighLighted < 48) then
  142.             return 1
  143.           else
  144.             return 0
  145.           end if
  146.         end if
  147.       end if
  148.     end if
  149.   end if
  150. end
  151.